<?php
$eladasok = $this->ctrl->eladasok;
?>
<!doctype html>
<html>
	<head>
		<meta charset="utf-8">
		<title>POS</title>
		<link rel="stylesheet" href="<?= $css; ?>style.css" media="screen">
		<link rel="stylesheet" href="<?= $css.$url[0].".css"; ?>" media="screen">
		<script type="text/javascript" src="<?= $js; ?>jquery.min.js"></script>
		<script type="text/javascript">
			var root = "http://pos.phbusiness.eu/";
			var link = root + "index.php?url=";
		
			function redirect(to){
				window.location.href = link + to;
			}
		</script>
	</head>

	<body>
		<div id="msg" style="display: none;"><?= isset($msg) ? $msg : ""; ?></div>

		<div id="content">
			<?php if(!isset($_POST["zaras"])){ ?>
				<form action="" method="POST">
					<h2>Adja meg a zárás kezdő és vég dátumait</h2>
					Kezdő dátum:<br>
					<input type="date" name="kezdo" value=""><br>
					Vég dátum:<br>
					<input type="date" name="veg" value=""><br>
					<input type="submit" name="zaras" value="Zárás készítése">
				</form>
			<?php } else { ?>
				<div>
					<?= $this->ctrl->route; ?><br>
					<input type="button" value="Vissza" onclick="window.location.href='<?= $link; ?>closing'">
				</div>
			<?php } ?>
		</div>

		<div id="footer">
			<img src="<?= $img; ?>usr/<?= $usr[0]; ?>.png">
			<?= $usr[1]; ?>
			<span><input type="button" value="Kijelentkezés" onclick="redirect('&logout=');"></span>
		</div>

		<script type="text/javascript">
			function setSize(){
				$('#content').css({
					'height' : $(window).height()-50-20,
					'font-size' : $(window).height()/18
				});

				$('#content input').css({'font-size' : $(window).height()/18});
				$('#content button').css({'font-size' : $(window).height()/18});

				$('#content form').css({
					'margin-top' : ($('#content').height()-$('#content form').height())/2
				});

				$('#content div').css({
					'margin-top' : ($('#content').height()-$('#content div').height())/2
				});
			}

			$(window).resize(function(){ setSize(); });

			setSize();

			var msg = document.getElementById("msg");
			if(0 < msg.innerHTML.length){ alert(msg.innerHTML); }
		</script>
	</body>
</html>